#include <stdio.h>
#include <stdlib.h>
#include "pcb.h"
#include "scheduler.h"
#include "display.h"
#include "io.h"

int processes;

char * secret_decoder(State st)
 {
	 switch(st)
	 {
		 case state_ready: return "ready\0";
		 case state_running: return "running\0";
		 case state_blocked: return "blocked\0";
	 }
 }

void print() {
	printf("-----------------------------\n");
	printf("|Process ID\t| State\t| PC|\n");
	printf("-----------------------------\n");
	int i;
	for(i = 0; i < processes; i++) {
		printf("|%d\t\t| %s\t| %d |\n", process_list[i].id, secret_decoder(process_list[i].state), process_list[i].pc);
		//printf("%d", process_list[i].id);
	}
	printf("-----------------------------\n");
	printStatus();
}

void set_process(int proc) {
	processes = proc;
}
